{template 'common/header'}
<!--http://localhost/web/index.php?c=site&a=entry&do=device&m=xdian-->
<div class="w1200 m0a">
    <script language="javascript">require(['underscore']);</script>
    <!-- 导入CSS样式 -->
    <!--<link href="../addons/small/assets/css/designer.css" rel="stylesheet">-->
    <!-- 头部选项卡 -->

    <div class="ulleft-nav">
        <ul class="nav nav-tabs">
            <div class="addtit-name"> 设备列表<article></article></div>
            <!--<li class="active"></li>-->
            <a class="btn btn-primary" href="{php echo $this->createWebUrl('device_edit')}" style="margin-bottom:5px;"><i class="fa fa-plus"></i> 添加设备</a>
            <a class="btn btn-primary" href="{php echo $this->createWebUrl('device_edit')}" style="margin-bottom:5px;"><i class="fa fa-file-excel-o"></i> 批量导入</a>
        </ul>
    </div>

    <div class="rightlist">

        <!-- 筛选区域 -->
        <div class="panel panel-info">
            <div class="panel-heading">筛选</div>
            <div class="panel-body">
                <form action="{php echo $this->createWebUrl('device')}" method="get" class="form-horizontal" role="form">
                    <input type="hidden" name="c" value="site" />
                    <input type="hidden" name="a" value="entry" />
                    <input type="hidden" name="m" value="small" />
                    <input type="hidden" name="do" value="index" />
                    <input type="hidden" name="p" value="designer" />
                    <div class="form-group">
                        <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">关键字</label>
                        <div class="col-sm-8 col-lg-9">
                            <input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}" placeholder="请输入名称进行搜索">
                        </div>
                        <div class=" col-xs-12 col-sm-2 col-lg-2">
                            <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <!-- 页面列表 -->
        <div class='panel panel-default'>
            <div class='panel-heading'> 页面管理 {if $pagesnum}(总数: {$pagesnum}){/if}</div>
            <div class='panel-body'>
                <table class="table">
                    <thead>
                    <tr>
                        <th style=" text-align: center;">ID</th>
                        <th style=" text-align: center;">设备名称</th>
                        <th style=" text-align: center;">设备KEY</th>
                        <th style=" text-align: center;">批次</th>
                        <th style=" text-align: center;">地址</th>
                        <th style=" text-align: center;">设备组别</th>
                        <th style=" text-align: center;">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {if !empty($deviceList)}
                    {loop $deviceList $device}
                    <tr pageid="{$page['id']}">
                        <td style="text-align: center;">{$device['id']}</td>
                        <td style="text-align: center;">{$device['device_name']}</td>
                        <td style="text-align: center;">{$device['key']}</td>
                        <td style="text-align:  center;">{$device['batch_number']}</td>
                        <td style="text-align:  center;">{$device['address']}</td>
                        <td style="text-align:  center;">{$device['device_group_id']}</td>
                        <td><a href="{php echo $this->createWebUrl('device_edit', ['device_id' => $device['id']])}">编辑</a></td>
                    </tr>
                    {/loop}
                    {else}
                    <tr>
                        <td style="text-align: center; line-height: 100px;" colspan="8">亲~您还没有设备</td>
                    </tr>
                    {/if}
                    <tr><td colspan="8" style="padding:0px; margin: 0px;">{$pager}</td></tr>
                    </tbody>
                </table>
            </div>
        </div>

    </div>
</div>
{template 'common/footer'}